package com.entity;

import com.annotation.ColumnInfo;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.utils.DateUtil;
import org.apache.commons.beanutils.BeanUtils;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.util.Date;


/**
 * 用户
 *
 * @author
 * @email
 */
@TableName("yonghu")
public class YonghuEntity<T> implements Serializable {
    private static final long serialVersionUID = 1L;


    public YonghuEntity() {

    }

    public YonghuEntity(T t) {
        try {
            BeanUtils.copyProperties(this, t);
        } catch (IllegalAccessException | InvocationTargetException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }


    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    @ColumnInfo(comment = "主键", type = "int(11)")
    @TableField(value = "id")

    private Integer id;


    /**
     * 账户
     */
    @ColumnInfo(comment = "账户", type = "varchar(200)")
    @TableField(value = "username")

    private String username;


    /**
     * 密码
     */
    @ColumnInfo(comment = "密码", type = "varchar(200)")
    @TableField(value = "password")

    private String password;


    /**
     * 用户姓名
     */
    @ColumnInfo(comment = "用户姓名", type = "varchar(200)")
    @TableField(value = "yonghu_name")

    private String yonghuName;


    /**
     * 性别
     */
    @ColumnInfo(comment = "性别", type = "int(11)")
    @TableField(value = "sex_types")

    private Integer sexTypes;


    /**
     * 用户头像
     */
    @ColumnInfo(comment = "用户头像", type = "varchar(200)")
    @TableField(value = "yonghu_photo")

    private String yonghuPhoto;


    /**
     * 身份证号
     */
    @ColumnInfo(comment = "身份证号", type = "varchar(200)")
    @TableField(value = "yonghu_id_number")

    private String yonghuIdNumber;


    /**
     * 联系方式
     */
    @ColumnInfo(comment = "联系方式", type = "varchar(200)")
    @TableField(value = "yonghu_phone")

    private String yonghuPhone;


    /**
     * 电子邮箱
     */
    @ColumnInfo(comment = "电子邮箱", type = "varchar(200)")
    @TableField(value = "yonghu_email")

    private String yonghuEmail;


    /**
     * 逻辑删除
     */
    @ColumnInfo(comment = "逻辑删除", type = "int(11)")
    @TableField(value = "yonghu_delete")

    private Integer yonghuDelete;


    /**
     * 创建时间
     */
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat
    @ColumnInfo(comment = "创建时间", type = "timestamp")
    @TableField(value = "create_time", fill = FieldFill.INSERT)

    private Date createTime;


    /**
     * 获取：主键
     */
    public Integer getId() {
        return id;
    }

    /**
     * 设置：主键
     */

    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 获取：账户
     */
    public String getUsername() {
        return username;
    }

    /**
     * 设置：账户
     */

    public void setUsername(String username) {
        this.username = username;
    }

    /**
     * 获取：密码
     */
    public String getPassword() {
        return password;
    }

    /**
     * 设置：密码
     */

    public void setPassword(String password) {
        this.password = password;
    }

    /**
     * 获取：用户姓名
     */
    public String getYonghuName() {
        return yonghuName;
    }

    /**
     * 设置：用户姓名
     */

    public void setYonghuName(String yonghuName) {
        this.yonghuName = yonghuName;
    }

    /**
     * 获取：性别
     */
    public Integer getSexTypes() {
        return sexTypes;
    }

    /**
     * 设置：性别
     */

    public void setSexTypes(Integer sexTypes) {
        this.sexTypes = sexTypes;
    }

    /**
     * 获取：用户头像
     */
    public String getYonghuPhoto() {
        return yonghuPhoto;
    }

    /**
     * 设置：用户头像
     */

    public void setYonghuPhoto(String yonghuPhoto) {
        this.yonghuPhoto = yonghuPhoto;
    }

    /**
     * 获取：身份证号
     */
    public String getYonghuIdNumber() {
        return yonghuIdNumber;
    }

    /**
     * 设置：身份证号
     */

    public void setYonghuIdNumber(String yonghuIdNumber) {
        this.yonghuIdNumber = yonghuIdNumber;
    }

    /**
     * 获取：联系方式
     */
    public String getYonghuPhone() {
        return yonghuPhone;
    }

    /**
     * 设置：联系方式
     */

    public void setYonghuPhone(String yonghuPhone) {
        this.yonghuPhone = yonghuPhone;
    }

    /**
     * 获取：电子邮箱
     */
    public String getYonghuEmail() {
        return yonghuEmail;
    }

    /**
     * 设置：电子邮箱
     */

    public void setYonghuEmail(String yonghuEmail) {
        this.yonghuEmail = yonghuEmail;
    }

    /**
     * 获取：逻辑删除
     */
    public Integer getYonghuDelete() {
        return yonghuDelete;
    }

    /**
     * 设置：逻辑删除
     */

    public void setYonghuDelete(Integer yonghuDelete) {
        this.yonghuDelete = yonghuDelete;
    }

    /**
     * 获取：创建时间
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * 设置：创建时间
     */

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    public String toString() {
        return "Yonghu{" +
                ", id=" + id +
                ", username=" + username +
                ", password=" + password +
                ", yonghuName=" + yonghuName +
                ", sexTypes=" + sexTypes +
                ", yonghuPhoto=" + yonghuPhoto +
                ", yonghuIdNumber=" + yonghuIdNumber +
                ", yonghuPhone=" + yonghuPhone +
                ", yonghuEmail=" + yonghuEmail +
                ", yonghuDelete=" + yonghuDelete +
                ", createTime=" + DateUtil.convertString(createTime, "yyyy-MM-dd") +
                "}";
    }
}
